package com.film.admincontroller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.film.service.FilmService;
import com.film.service.impl.FilmServiceImpl;

@WebServlet("/grounding.do")
public class GroundingFilmController extends HttpServlet{
	private FilmService filmService = new FilmServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String filmId = request.getParameter("filmId");
		int result = filmService.groundingFilm(Integer.parseInt(filmId));
		if(result == 1) {
			response.sendRedirect("/film/showFilmExhibition.do");
		}
	}
}
